//
// Created by Administrator on 2023-11-15.
//

#ifndef MULTIMODULE_MAINWINDOW_H
#define MULTIMODULE_MAINWINDOW_H

#include <QMainWindow>
#include <QPoint>
#include <QRect>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow() override;
    bool eventFilter(QObject *watched, QEvent *event);
    bool isInFrameSection(const QPoint &pos, Qt::WindowFrameSection edge);
    Qt::WindowFrameSection getEdgeSection(const QPoint &pos);
    void setCursorStyle(const QPoint &pos);
    bool isHeadDBClick(long long timestamp);
    void headDBClick();
private:
    Ui::MainWindow *ui;

    QPoint dragStartPosition;
    QRect windowGeometry;
    Qt::WindowFrameSection frameSection;
    bool isResizing;
    bool isDragging;
    int distance = 10;
    long long currentTimeStamp;
private slots:
    void on_closeBtn_clicked();
    void on_maximizeBtn_clicked();
    void on_minimizeBtn_clicked();
};

#endif //MULTIMODULE_MAINWINDOW_H
